package cn.iocoder.yudao.module.dr.dal.mysql.collectionattachment;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.dr.dal.dataobject.collectionattachment.CollectionAttachmentDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.dr.controller.admin.collectionattachment.vo.*;

/**
 * 藏品附件 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface CollectionAttachmentMapper extends BaseMapperX<CollectionAttachmentDO> {

    default PageResult<CollectionAttachmentDO> selectPage(CollectionAttachmentPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CollectionAttachmentDO>()
                .eqIfPresent(CollectionAttachmentDO::getAttachmentId, reqVO.getAttachmentId())
                .eqIfPresent(CollectionAttachmentDO::getCollectionId, reqVO.getCollectionId())
                .eqIfPresent(CollectionAttachmentDO::getAttachType, reqVO.getAttachType())
                .betweenIfPresent(CollectionAttachmentDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CollectionAttachmentDO::getId));
    }

    public PageResult<CollectionAttachmentDO> getCollectionAttachmentPage(CollectionAttachmentPageReqVO pageReqVO);
}